<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>西瓜后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all" /> 
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all" /> 
    <link rel="stylesheet" href="../../../layuiadmin/style/purchase_management.css" media="all" /> 
</head>
<body>
<div class="layui-fluid layui-tab lay-filter="demo" lay-allowclose="true"">
    <!--tab切换选项卡-->
    <div class="layui-card box-tab">
        <div class="layui-card-body">
            <ul class="flex-container layui-tab-title">
                <li class="flex-item" data="yxdd" id="yxdd" class="layui-this"></li>
                <li class="flex-item" data="cgd"  id="cgd" lay-id="2"></li>
                <li class="flex-item" data="fhd"  id="fhd" lay-id="3"></li>
                <li class="flex-item" data="qsd"  id="qsd" lay-id="4"></li>
                <li class="flex-item" data="sxd"  id="sxd" lay-id="5"></li>
            </ul>
        </div>
    </div>

    <!--tab切换的内容-->
    <div class="layui-tab-content">

    <!--1.意向订单-->
    <div class="layui-form-item layui-tab-item layui-show" id="yxdd">
    <div class="layui-card" >
        <form class="layui-form layui-form-search layui-clear" action="">
            <div class="search-term ">
                <label class="layui-form-label">订单号</label>
                <div class="layui-input-inline ">
                    <input type="text" name="" placeholder="请输入订单号" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="search-term">
                <label class="layui-form-label">下订时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="start"  placeholder="请选择日期"class="layui-input Wdate" id="date"/>
                </div>
            </div>
            <div class="search-term">
                <label class="layui-form-label">经销商</label>
                <div class="layui-input-inline ">
                    <select name="orderNub">
                        <option value="">请选择</option>
                    </select>
                </div>
            </div>
            <div class="search-term">
                <label class="layui-form-label">订单状态</label>
                <div class="layui-input-inline">
                    <select name="carStatus" lay-filter="aihao">
                        <option value="">请选择</option>
                        <option value="0">待平台确认</option>
                        <option value="1">待财务确认</option>
                        <option value="1">待录入车架号</option>
                        <option value="1">待生成采购单</option>
                        <option value="1">备货中</option>
                        <option value="1">已签收</option>
                    </select>
                </div>
            </div>
            <div class="search-term">
                <label class="layui-form-label">&nbsp;</label>
                <button class="layui-btn layui-bg-blue layui-btn-sm" lay-submit lay-filter="LAY-user-back-search">
                    <i class="layui-icon layui-icon-defined layui-icon-search"></i> 查询
                </button>
            </div>
        </form>
        </div>

        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">订单列表</div>
                <div class="layui-card-body layadmin-takerates">
                    <table class="layui-table" id="yxddOrderList" lay-filter="listTable"></table>
                    <script type="text/html" id="yxddDemo">
                        <a class="layui-text-blue layui-btn-xs" lay-event="enter">进入</a>
                    </script>
                </div>
            </div>
        </div>
    </div>

    <!--2.采购/延期订单-->
    <div class="layui-form-item layui-tab-item layui-show" id="cgd">
        <div class="layui-card" >
            <form class="layui-form layui-form-search layui-clear" action="">
                <div class="search-term">
                    <label class="layui-form-label">订单号</label>
                    <div class="layui-input-inline ">
                        <input type="text" name="" placeholder="请输入订单号" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="search-term">
                    <label class="layui-form-label">建档时间</label>
                    <div class="layui-input-inline">
                        <input type="text" name="start"  placeholder="请选择日期 "class="layui-input Wdate" id="date"/>
                    </div>
                </div>
                <div class="search-term">
                    <label class="layui-form-label">经销商</label>
                    <div class="layui-input-inline ">
                        <select name="orderNub">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
                <div class="search-term">
                    <label class="layui-form-label">订单类型</label>
                    <div class="layui-input-inline">
                        <select name="carStatus" lay-filter="aihao">
                            <option value="">请选择</option>
                            <option value="0">采购单</option>
                            <option value="1">延期</option>
                        </select>
                    </div>
                </div>
                <div class="search-term">
                    <label class="layui-form-label">&nbsp;</label>
                    <button class="layui-btn layui-bg-blue layui-btn-sm" lay-submit lay-filter="LAY-user-back-search">
                        <i class="layui-icon layui-icon-defined layui-icon-search"></i> 查询
                    </button>
                </div>
            </form>
            </div>
        
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">订单列表</div>
                    <div class="layui-card-body layadmin-takerates">
                        <table class="layui-table" id="cgdOrderList" lay-filter="listTable"></table>
                        <script type="text/html" id="cgdDemo">
                            <a class="layui-text-blue layui-btn-xs" lay-event="enter">发货</a>
                        </script>
                    </div>
                </div>
            </div>
        </div>

        <!--3.发货单-->
    
        <div class="layui-form-item layui-tab-item layui-show" id="fhd">
            <div class="layui-card" >
                <form class="layui-form layui-form-search layui-clear" action="">
                    <div class="search-term">
                        <label class="layui-form-label">订单号</label>
                        <div class="layui-input-inline ">
                            <input type="text" name="" placeholder="请输入订单号" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="search-term">
                        <label class="layui-form-label">发货时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="start"  placeholder="请选择日期"class="layui-input Wdate" id="date"/>
                        </div>
                    </div>
                    <div class="search-term">
                        <label class="layui-form-label">经销商</label>
                        <div class="layui-input-inline ">
                            <select name="orderNub">
                                <option value="">请选择</option>
                            </select>
                        </div>
                    </div>
                    <div class="search-term">
                        <label class="layui-form-label">&nbsp;</label>
                        <button class="layui-btn layui-bg-blue layui-btn-sm" lay-submit lay-filter="LAY-user-back-search">
                            <i class="layui-icon layui-icon-defined layui-icon-search"></i> 查询
                        </button>
                    </div>
                </form>
                </div>
        
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">订单列表</div>
                        <div class="layui-card-body layadmin-takerates">
                            <table class="layui-table" id="fhdOrderList" lay-filter="listTable"></table>
                            <script type="text/html" id="fhdDemo">
                                <a class="layui-text-blue layui-btn-xs" lay-event="ruhkxx">录入还款信息</a>
                                <a class="layui-text-blue layui-btn-xs" lay-event="details">详情</a>
                            </script>
                        </div>
                    </div>
                </div>
            </div>
            
            <!--4.签收单-->
            <div class="layui-form-item layui-tab-item layui-show" id="qsd">
                <div class="layui-card" >
                    <form class="layui-form layui-form-search layui-clear" action="">
                        <div class="search-term">
                            <label class="layui-form-label">订单号</label>
                            <div class="layui-input-inline ">
                                <input type="text" name="" placeholder="请输入订单号" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="search-term">
                            <label class="layui-form-label">签收时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="start"  placeholder="请选择日期"class="layui-input Wdate" id="date"/>
                            </div>
                        </div>
                        <div class="search-term">
                            <label class="layui-form-label">经销商</label>
                            <div class="layui-input-inline ">
                                <select name="orderNub">
                                    <option value="">请选择</option>
                                </select>
                            </div>
                        </div>
                        <div class="search-term">
                            <label class="layui-form-label">&nbsp;</label>
                            <button class="layui-btn layui-bg-blue layui-btn-sm" lay-submit lay-filter="LAY-user-back-search">
                                <i class="layui-icon layui-icon-defined layui-icon-search"></i> 查询
                            </button>
                        </div>
                    </form>
                </div>
            
                    <div class="layui-col-md12">
                        <div class="layui-card">
                            <div class="layui-card-header">订单列表</div>
                            <div class="layui-card-body layadmin-takerates">
                                <table class="layui-table" id="qsdOrderList" lay-filter="listTable"></table>
                                <script type="text/html" id="qsdDemo">
                                    <a class="layui-text-blue layui-btn-xs" lay-event="ruhkxx">录入还款信息</a>
                                    <a class="layui-text-blue layui-btn-xs" lay-event="qsddetails">详情</a>
                                </script>
                            </div>
                        </div>
                    </div>
                </div>

                <!--5.失效单-->
                <div class="layui-form-item layui-tab-item" id="sxd">
                <div class="layui-card" >
                        <form class="layui-form layui-form-search layui-clear" action="">
                            <div class="search-term">
                                <label class="layui-form-label">订单号</label>
                                <div class="layui-input-inline ">
                                    <input type="text" name="" placeholder="请输入订单号" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="search-term">
                                <label class="layui-form-label">下订时间</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="start"  placeholder="请选择日期"class="layui-input Wdate" id="date"/>
                                </div>
                            </div>
                            <div class="search-term">
                                <label class="layui-form-label">经销商</label>
                                <div class="layui-input-inline ">
                                    <select name="orderNub">
                                        <option value="">请选择</option>
                                    </select>
                                </div>
                            </div>
                            <div class="search-term">
                                    <label class="layui-form-label">失效类型</label>
                                    <div class="layui-input-inline ">
                                        <select name="orderNub">
                                            <option value="">请选择</option>
                                            <option value="0">平台退回</option>
                                            <option value="1">门店取消</option>
                                        </select>
                                    </div>
                                </div>
                            <div class="search-term">
                                <label class="layui-form-label">&nbsp;</label>
                                <button class="layui-btn layui-bg-blue layui-btn-sm" lay-submit lay-filter="LAY-user-back-search">
                                    <i class="layui-icon layui-icon-defined layui-icon-search"></i> 查询
                                </button>
                            </div>
                        </form>
                    </div>
                
                        <div class="layui-col-md12">
                            <div class="layui-card">
                                <div class="layui-card-header">订单列表</div>
                                <div class="layui-card-body layadmin-takerates">
                                    <table class="layui-table" id="sxdOrderList" lay-filter="listTable"></table>
                                    <script type="text/html" id="sxdDemo">
                                        <a class="layui-text-blue layui-btn-xs" lay-event="cxxd">重新下订</a>
                                        <a class="layui-text-blue layui-btn-xs" lay-event="sxddetails">详情</a>
                                    </script>
                                </div>
                            </div>
                        </div>
                   </div>

    </div>
</div>
</div>
<script src="../../../layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
        list: 'purchase_management/list', //list模块
    }).use(['index','list','form','jquery'],function () {
    
      var form = layui.form
      ,$ = layui.jquery
      ,element = layui.element;
      
      
      
      //触发事件
  var active = {
   
    tabChange: function(){
      //切换到指定Tab项
      element.tabChange('demo', '1'); //切换到：意向订单
      element.tabChange('demo', '2'); //切换到：延期采购
      element.tabChange('demo', '3'); //切换到：发货单
      element.tabChange('demo', '2'); //切换到：延期采购
      element.tabChange('demo', '2'); //切换到：延期采购
    }
  };

    //头部按钮点击事件
      $('#yxdd').addClass('li-active-yxdd');

      $('.flex-item').click(function(){
          console.log(111);
         
          currentData = $(this).attr('data')
          console.log(currentData);
          if(currentData == 'yxdd'){

             $(this).addClass('li-active-yxdd');
             $(this).siblings().removeClass('li-active-cgd');
             $(this).siblings().removeClass('li-active-fhd');
             $(this).siblings().removeClass('li-active-qsd');
             $(this).siblings().removeClass('li-active-sxd');
          

          }if(currentData == 'cgd'){
             
             $(this).addClass('li-active-cgd');
             $(this).siblings().removeClass('li-active-yxdd');
             $(this).siblings().removeClass('li-active-fhd');
             $(this).siblings().removeClass('li-active-qsd');
             $(this).siblings().removeClass('li-active-sxd');

          }if(currentData == 'fhd'){

             $(this).addClass('li-active-fhd');
             $(this).siblings().removeClass('li-active-yxdd');
             $(this).siblings().removeClass('li-active-cgd');
             $(this).siblings().removeClass('li-active-qsd');
             $(this).siblings().removeClass('li-active-sxd');

          }if(currentData == 'qsd'){

             $(this).addClass('li-active-qsd');
             $(this).siblings().removeClass('li-active-yxdd');
             $(this).siblings().removeClass('li-active-cgd');
             $(this).siblings().removeClass('li-active-fhd');
             $(this).siblings().removeClass('li-active-sxd'); 

          }if(currentData == 'sxd'){

            $(this).addClass('li-active-sxd'); 
            $(this).siblings().removeClass('li-active-yxdd');
            $(this).siblings().removeClass('li-active-cgd');
            $(this).siblings().removeClass('li-active-fhd');
            $(this).siblings().removeClass('li-active-qsd');
            
          }
        // $(this).addClass('li-active-sxd').siblings().removeClass('li-active-sxd');
     });


    });
</script>
<script type="text/javascript">
    
</script>
</body>
</html>